package com.cysion.study.ui.personal

import android.os.Bundle
import android.view.View
import com.cysion.study.ktbox.base.BaseActivity
import com.cysion.study.ktbox.utils.whiteTextTheme
import com.cysion.other.color
import com.cysion.other.startActivity_ex
import com.cysion.study.uibox.bar.TopBar
import com.cysion.study.R
import com.cysion.study.constant.BUNDLE_KEY
import kotlinx.android.synthetic.main.activity_trusteeship.*

/**
 * 旧页面 托管  暂停使用
 * Created by chu on 2019-07-01.
 */
class TrusteeshipActivity:BaseActivity(), View.OnClickListener {


    override fun getLayoutId(): Int = R.layout.activity_trusteeship

    override fun initView() {
        whiteTextTheme(color(R.color.main_cl))
        topbar.apply {
            setTitle("托管")
            setOnTopBarClickListener { obj, pos ->
                if (pos == TopBar.Pos.LEFT) {
                    finish()
                }
            }
        }
        tv_item4.setOnClickListener(this)
        tv_item3.setOnClickListener(this)
        tv_item2.setOnClickListener(this)
        tv_item1.setOnClickListener(this)

    }

    override fun onClick(v: View?) {
        when (v?.id) {
            R.id.tv_item1->{
                self.startActivity_ex<StudentAttentActivity>()//学生考勤
            }
            R.id.tv_item2->{//
                var bundle = Bundle()
                bundle.putString("type", "1")//1请假,2早走,3晚走,4未续费
                self.startActivity_ex<AttentLeaveActivity>(BUNDLE_KEY, bundle)//请假
            }
            R.id.tv_item3->{//历史评价
                self.startActivity_ex<HistoryCommentActivity>()//历史点评
            }
            R.id.tv_item4->{//托管续费人数
                var bundle = Bundle()
                bundle.putString("type", "4")//1请假,2早走,3晚走,4未续费
                self.startActivity_ex<AttentLeaveActivity>(BUNDLE_KEY, bundle)
            }

        }

    }


    override fun closeMvp() {
    }
}